﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RaytracerLib.Postprocessing;
using System.ComponentModel;
using RaytracerLib.Resamplers.Filters;

namespace Raytracer.PropertyGridDecorators
{
    public class FilterProperties
    {
        public Filter Filter;

        public FilterProperties(Filter a_filter)
        {
            Filter = a_filter;
        }
    }

    public class MitchellFilterProperties : FilterProperties
    {
        private MitchellFilter m_filter;

        public MitchellFilterProperties(MitchellFilter a_filter)
            : base(a_filter)
        {
            m_filter = a_filter;
        }

        [TypeConverter(typeof(DoubleConverter))]
        public double B
        {
            get
            {
                return m_filter.B;
            }
            set
            {
                m_filter.B = value;
            }
        }

        [TypeConverter(typeof(DoubleConverter))]
        public double C
        {
            get
            {
                return m_filter.C;
            }
            set
            {
                m_filter.C = value;
            }
        }
    }

    public class BicubicFilterProperties : FilterProperties
    {
        private BicubicFilter m_filter;

        public BicubicFilterProperties(BicubicFilter a_filter)
            : base(a_filter)
        {
            m_filter = a_filter;
        }

        [TypeConverter(typeof(DoubleConverter))]
        public double A
        {
            get
            {
                return m_filter.A;
            }
            set
            {
                m_filter.A = value;
            }
        }
    }

    public class LanczosFilterProperties : FilterProperties
    {
        private LanczosFilter m_filter;

        public LanczosFilterProperties(LanczosFilter a_filter)
            : base(a_filter)
        {
            m_filter = a_filter;
        }

        [TypeConverter(typeof(DoubleConverter))]
        public double Tau
        {
            get
            {
                return m_filter.Tau;
            }
            set
            {
                m_filter.Tau = value;
            }
        }
    }

    public class GaussianFilterProperties : FilterProperties
    {
        private GaussianFilter m_filter;

        public GaussianFilterProperties(GaussianFilter a_filter)
            : base(a_filter)
        {
            m_filter = a_filter;
        }

        [TypeConverter(typeof(DoubleConverter))]
        public double Alpha
        {
            get
            {
                return m_filter.Alpha;
            }
            set
            {
                m_filter.Alpha = value;
            }
        }
    }
}
